bitkeeper revision 1.1236.31.1 (4235d7e6zfwsw0_e5xhU8KHoDsP69Q)
authordjm@djmnc4000.(none) <djm@djmnc4000.(none)>
Mon, 14 Mar 2005 18:28:54 +0000 (18:28 +0000)
committerdjm@djmnc4000.(none) <djm@djmnc4000.(none)>
Mon, 14 Mar 2005 18:28:54 +0000 (18:28 +0000)
config.h, xenmisc.c, xenasm.S, process.c, domain.c:
  cleanup

BitKeeper/etc/logging_ok
xen/arch/ia64/domain.c
xen/arch/ia64/process.c
xen/arch/ia64/xenasm.S
xen/arch/ia64/xenmisc.c
xen/include/asm-ia64/config.h

index fde76498a42b5a503394b0d43e9c46a508ea5649..a937ce2b437f56108ba1d87aae2a741bcbba0f4e 100644 (file)
@@ -20,6 +20,7 @@ cl349@freefall.cl.cam.ac.uk
 cl349@labyrinth.cl.cam.ac.uk
 cwc22@centipede.cl.cam.ac.uk
 cwc22@donkeykong.cl.cam.ac.uk
+djm@djmnc4000.(none)
 djm@kirby.fc.hp.com
 gm281@boulderdash.cl.cam.ac.uk
 gm281@tetrapod.cl.cam.ac.uk
index c5f1533f88be729f1e8ecb029a6a0cc859f8f253..abdcf203a560b50bb42502cf04b61dbd7f954ca0 100644 (file)
@@ -670,6 +670,7 @@ void dummy(void)
 }
 
 
+#if 0
 void switch_to(struct exec_domain *prev, struct exec_domain *next)
 {
        struct exec_domain *last;
@@ -677,6 +678,7 @@ void switch_to(struct exec_domain *prev, struct exec_domain *next)
        __switch_to(prev,next,last);
        //set_current(next);
 }
+#endif
 
 void domain_pend_keyboard_interrupt(int irq)
 {
index 889ecd0d78f7cd61273b958fd562588bda43c468..a15c6f53a812babda4a9030e8d5f7d380a63392a 100644 (file)
@@ -143,15 +143,13 @@ void reflect_interruption(unsigned long ifa, unsigned long isr, unsigned long it
        }
        if (!PSCB(ed,interrupt_collection_enabled)) {
                if (!(PSCB(ed,ipsr) & IA64_PSR_DT)) {
-                       printf("psr.dt off, trying to deliver nested dtlb!\n");
-                       while(1);
+                       panic_domain(regs,"psr.dt off, trying to deliver nested dtlb!\n");
                }
                vector &= ~0xf;
                if (vector != IA64_DATA_TLB_VECTOR &&
                    vector != IA64_DATA_TLB_VECTOR) {
-printf("psr.ic off, delivering fault=%lx,iip=%p,isr=%p,PSCB.iip=%p\n",
+panic_domain(regs,"psr.ic off, delivering fault=%lx,iip=%p,isr=%p,PSCB.iip=%p\n",
        vector,regs->cr_iip,isr,PSCB(ed,iip));
-                       while(1);
                        
                }
 //printf("Delivering NESTED DATA TLB fault\n");
@@ -243,9 +241,6 @@ void xen_handle_domain_access(unsigned long address, unsigned long isr, struct p
        unsigned long lookup_domain_mpa(struct domain *,unsigned long);
        unsigned long match_dtlb(struct exec_domain *,unsigned long, unsigned long *, unsigned long *);
        IA64FAULT fault;
-#ifndef USER_ACCESS
-       extern void __get_domain_bundle(void);
-#endif
 
 // NEED TO HANDLE THREE CASES:
 // 1) domain is in metaphysical mode
@@ -268,13 +263,6 @@ void xen_handle_domain_access(unsigned long address, unsigned long isr, struct p
                vcpu_itc_no_srlz(ed,2,address,pteval,-1UL,PAGE_SHIFT);
                return;
        }
-#ifndef USER_ACCESS
-       if (*(unsigned long *)__get_domain_bundle != iip) {
-               printf("Bad user space access @%p ",address);
-               printf("iip=%p, ipsr=%p, b0=%p\n",iip,psr,regs->b0);
-               while(1);
-       }
-#endif
 if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
                
        // if we are fortunate enough to have it in the 1-entry TLB...
@@ -285,13 +273,6 @@ if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
        // look in the TRs
        fault = vcpu_tpa(ed,address,&mpaddr);
        if (fault != IA64_NO_FAULT) {
-#ifndef USER_ACCESS
-               // this is hardcoded to handle __get_domain_bundle only
-               regs->r8 = 0; regs->r9 = 0;
-               regs->cr_iip += 0x20;
-               //regs->cr_iip |= (2UL << IA64_PSR_RI_BIT);
-               return;
-#else /* USER_ACCESS */
                static int uacnt = 0;
                // can't translate it, just fail (poor man's exception)
                // which results in retrying execution
@@ -303,12 +284,10 @@ if (address < 0x4000) printf("WARNING: page_fault @%p, iip=%p\n",address,iip);
                else {
                        // should never happen.  If it does, region 0 addr may
                        // indicate a bad xen pointer
-                       printk("*** xen_handle_domain_access: exception table"
+                       panic_domain(regs,"*** xen_handle_domain_access: exception table"
                                " lookup failed, iip=%p, addr=%p, spinning...\n",
                                iip,address);
-                       while(1);
                }
-#endif /* USER_ACCESS */
        }
        if (d == dom0) {
                if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
@@ -375,7 +354,9 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_reg
        }
        vector = is_data ? IA64_DATA_TLB_VECTOR : IA64_INST_TLB_VECTOR;
        if (handle_lazy_cover(current, isr, regs)) return;
-if (!(address>>61)) { printf("ia64_do_page_fault: @%p???, iip=%p, itc=%p (spinning...)\n",address,iip,ia64_get_itc()); while(1); }
+if (!(address>>61)) {
+panic_domain(0,"ia64_do_page_fault: @%p???, iip=%p, itc=%p (spinning...)\n",address,iip,ia64_get_itc());
+}
        if ((isr & IA64_ISR_SP)
            || ((isr & IA64_ISR_NA) && (isr & IA64_ISR_CODE_MASK) == IA64_ISR_CODE_LFETCH))
        {
@@ -835,8 +816,7 @@ ia64_handle_reflection (unsigned long ifa, struct pt_regs *regs, unsigned long i
        unsigned long itir = vcpu_get_itir_on_fault(ed,ifa);
 
        if (!(psr & IA64_PSR_CPL)) {
-               printf("ia64_handle_reflection: reflecting with priv=0!!\n");
-               while(1);
+               panic_domain(regs,"ia64_handle_reflection: reflecting with priv=0!!\n");
        }
        // FIXME: no need to pass itir in to this routine as we need to
        // compute the virtual itir anyway (based on domain's RR.ps)
index 998a3d87d15d31bf2191cb1c92bc4d17b54cdd90..dc0771fa48d2301c19cd7d1cbccc1aea03933b12 100644 (file)
@@ -261,24 +261,6 @@ GLOBAL_ENTRY(ia64_prepare_handle_reflection)
        br.cond.sptk.many rp                    // goes to ia64_leave_kernel
 END(ia64_prepare_handle_reflection)
 
-#ifndef USER_ACCESS
-// REMOVE: replaced with get_user
-// NOTE: instruction spacing must be explicit for recovery on miss
-GLOBAL_ENTRY(__get_domain_bundle)
-       ld8 r8=[r32],8
-       nop 0
-       nop 0
-       ;;
-       ld8 r9=[r32]
-       nop 0
-       nop 0
-       ;;
-       br.ret.sptk.many rp
-       nop 0
-       nop 0
-       ;;
-END(__get_domain_bundle)
-#else
 GLOBAL_ENTRY(__get_domain_bundle)
        EX(.failure_in_get_bundle,ld8 r8=[r32],8)
        ;;
@@ -294,7 +276,6 @@ GLOBAL_ENTRY(__get_domain_bundle)
        br.ret.sptk.many rp
        ;;
 END(__get_domain_bundle)
-#endif
 
 GLOBAL_ENTRY(dorfirfi)
 #define SI_CR_IIP_OFFSET 0x10
index 1e69cf21f0a5081d6b34ae6a3c2f7218776d8a52..a5ae5a37ed10f8b730cf033626bd0174cc893e39 100644 (file)
@@ -203,7 +203,7 @@ char * __devinit  pcibios_setup(char *str)
 
 void show_registers(struct pt_regs *regs)
 {
-       dummy();
+       printf("*** ADD REGISTER DUMP HERE FOR DEBUGGING\n");
 }      
 
 ///////////////////////////////
@@ -240,12 +240,36 @@ void *module_text_address(unsigned long addr)
        return NULL;
 }
 
+void cs10foo(void) {}
+void cs01foo(void) {}
+
 // context_switch
 void context_switch(struct exec_domain *prev, struct exec_domain *next)
 {
-       switch_to(prev,next);
+printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+printk("@@@@@@ context switch from domain %d (%x) to domain %d (%x)\n",
+prev->domain->id,(long)prev&0xffffff,next->domain->id,(long)next&0xffffff);
+printk("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
+if (prev->domain->id == 1 && next->domain->id == 0) cs10foo();
+if (prev->domain->id == 0 && next->domain->id == 1) cs01foo();
+       switch_to(prev,next,prev);
        clear_bit(EDF_RUNNING, &prev->ed_flags);
        //if (!is_idle_task(next->domain) )
                //send_guest_virq(next, VIRQ_TIMER);
-       schedule_tail(next);
+       load_region_regs(current);
+}
+
+void panic_domain(struct pt_regs *regs, const char *fmt, ...)
+{
+       va_list args;
+       char buf[128];
+       struct exec_domain *ed = current;
+       static volatile int test = 1;   // so can continue easily in debug
+    
+       printf("$$$$$ PANIC in domain %d:",ed->domain->id);
+       va_start(args, fmt);
+       (void)vsnprintf(buf, sizeof(buf), fmt, args);
+       va_end(args);
+       if (regs) show_registers(regs);
+       while(test);
 }
index c1cf1cd259d12d07d5828718e26ad3f54997f072..209d4c7b5991ee37e473d287bac6a12867e14afe 100644 (file)
@@ -1,6 +1,6 @@
 // control flags for turning on/off features under test
-#undef CLONE_DOMAIN0
-//#define CLONE_DOMAIN0 1
+//#undef CLONE_DOMAIN0
+#define CLONE_DOMAIN0 1
 //#undef CLONE_DOMAIN0
 #define USER_ACCESS